Version

ReplaceAll(DocumentSpan[],String,String,String,FindCriteria) Method

Replaces all instances of textToFind in the specified document spans with the replacementText. Performs case-insensitive search by default.
Syntax
'Declaration
 
Public Overloads Function ReplaceAll( _
   ByVal spans() As DocumentSpan, _
   ByVal textToFind As String, _
   ByVal replacementText As String, _
   ByRef error As String, _
   Optional ByVal findCriteria As FindCriteria _
) As ReplaceResult
public ReplaceResult ReplaceAll( 
   DocumentSpan[] spans,
   string textToFind,
   string replacementText,
   out string error,
   FindCriteria findCriteria
)

Parameters

spans
The replacement operation will be restricted to content in these document spans.
textToFind
Text to replace. This can be a wildcard as well by specifying findCriteria parameter with FindCriteria.Operator of FindOperator.Wildcard. Note that specifying null or empty string will do nothing and return a ReplaceResult object with 0 replacements.
replacementText
This is the text that will replace each instance of textToFind.
error
This will be set if an error occurs, such as when the 'textToFind' is indicated to be interpreted as a wild card but it's an invalid wildcard.
findCriteria
Used to specify whether it's a case sensitive search or whether to use wild card matching.

Return Value

A ReplaceResult object that contains a list of replacements that were made.
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also